<?php

namespace App\Http\Controllers;

use App\Models\Project;
use App\Services\SitemapService;
use Illuminate\Http\Request;

class SitemapController extends Controller
{
    public function index()
    {
        $sitemapService = new SitemapService();
        $sitemapService->buildIndex();
        dd(1);
        $post = Project::orderBy('updated_at', 'desc')->first();

        return response()->view('sitemap.index', [
            'post' => $post,
        ])->header('Content-Type', 'text/xml');
    }
}
